{extend name="public/base"/}
{block name="style"}
<link href="__PUBLIC__/ieasy/css/classify.css?v=2.1.49" rel="stylesheet" type="text/css">
<link href="__PUBLIC__/ieasy/css/book_details.css" rel="stylesheet" type="text/css">
<style>
.chapterNoPayBox{margin:10px;}
.chapterNoPayBox .liebiaoBox{border:1px solid #efeff4; height:45px; line-height:45px; text-align:center; font-size:16px;-moz-border-radius:6px;-webkit-border-radius:6px;border-radius:6px;}
.chapterNoPayBox .liebiaoBox a{display:block}
.chapterNoPayBox h5{ height:45px; line-height:45px; text-align:center; font-size:16px; color:#eb4f38}
.chapterNoPayBox .titleBox{margin:10px 0px; font-size:16px; text-align:center}
.chapterNoPayBox .priceBox{margin:10px 0px; font-size:14px; text-align:center}
.btn_top {
    height: 44px;
    line-height: 44px;
	padding: 0 8px;
    margin: 12px auto;
    background: #10AEFF;
    border: none;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    display: block;
    text-align: center;
}
</style>
{/block}
{block name="body"}
<div id="console_main"></div>
<div class="head_tit_box">
	<a href="javascript:;" class="head_return_page_but"></a>
		<div class="head_menu_but_box">
		<a href="javascript:;" class="head_menu_but"></a>
	</div>
		<h1>整本购买</h1>
</div>
<!--导航-->
{block name="include"}{include file="public:dropnav" /}{/block}
<!-- 这是正文  -->

<div class="body_sytle">
	<div class="chapterNoPayBox">
		<!--<h5>全本仅需{$sumegold}枚阅读币！</h5>-->
		<div class="liebiaoBox"><a href="{:url('novel/chapter/index',array('id'=>$bookinfo.id))}">《{$bookinfo.title}》章节列表</a></div>
		<div class="titleBox">当前章节：{$chapterinfo.chaptername}</div>
		<div class="priceBox">账户剩余阅读币：{$egold.egold} 枚； <!--<strong style="color:red;">全本</strong>所需阅读币：{$sumegold}枚--></div>
		
		{if $egold.egold >=$sumegold}
			<a href="Javascript:;" onclick="allbookbuy()" class="btn_top">全本购买</a>
		{else/}
			<a href="/pay/index?backurl={$backurl}" class="btn_top">立即充值</a>
		{/if}
	</div>
</div>


{/block}
{block name="script"}
<script type="text/javascript" src="__PUBLIC__/ieasy/js/zepto.min.js?v=2.1.49"></script>
<script type="text/javascript" src="__PUBLIC__/ieasy/js/zepto.cookie.min.js?v=2.1.49"></script>

<!-- 这是zepto插件 -->

<script type="text/javascript" src="__PUBLIC__/ieasy/js/common.js?v=2.1.49"></script>


<link rel="stylesheet" href="__PUBLIC__/ieasy/css/front.css" />
<link rel="stylesheet" href="__PUBLIC__/ieasy/css/vendor.css" />
<script src="__PUBLIC__/ieasy/js/vendor.js"></script>
<script src="__PUBLIC__/ieasy/js/app.js"></script>

<!-- 这里引入js -->
<script type="text/javascript">
$(function(){
	$('.bd_description_box a').click(function(){
		$(this).parent().removeClass('bd_description_open');
	});
	$("#book_page").change(function(){
		var url = $(this).val();
		window.location.href=url;
	})
});
</script>
<script type="text/javascript">
		
    <!--
		function allbookbuy(){
			var uid = {:session('user_auth.uid')},
			    url = "{:url('/chapter/batchbuy',array('bookid'=>$bookinfo.id,'chapterid'=>$chapterinfo.id))}",
				bookid= "{$bookinfo.id}",
				bookname= "{$bookinfo.title}",
				chapterid= "{$chapterinfo.id}",
				sumegold = {$sumegold};

			$.ajax({
			  url:url,
			  async: false,
			  dataType:'json',
			  data : {'uid':uid,'bookname':bookname,'sumegold':sumegold},
			  type:'post',
			  success:function(json){
				if(json.code == 1){	
					message(json.msg);
					setTimeout(function () {
						location.href = "/chapter/read/"+bookid+"/"+chapterid+"/";
					}, 1000);
				}else{
					message(json.msg)
				}
			  },
			  error:function(){
				message("对不起，服务器繁忙，请稍后再试!")
			  }
			});
		}

		function message(msg){
			$.modal({
				title: msg,
				text: '',
				buttons: [
					{text: '我知道啦'}
				]
            })
		}
		
    //-->
    </script>
{/block}